package com.example.designpatterns.decorator;

// 具体装饰器：为文本添加颜色效果
public class ColorDecorator extends TextDecorator {
    private String color;
    
    // 可选的颜色常量
    public static final String RED = "红色";
    public static final String GREEN = "绿色";
    public static final String BLUE = "蓝色";
    
    public ColorDecorator(TextComponent textComponent, String color) {
        super(textComponent);
        this.color = color;
    }
    
    @Override
    public String getContent() {
        return "[" + color + "] " + textComponent.getContent();
    }

    @Override
    public void display() {
        System.out.println(getContent());
    }
} 